<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>array.fill()</title>
  </head>
  <body>
    <p>array.fill()使用给定值填充数组,原数组元素被覆盖,如果是空数组，将无效</p>
    <p>array.fill(item,start,end)</p>
    <pre>
        [1,2,3].fill(4)   //[4,4,4]
        [1,2,3].fill(4,1)   // [1,4,4]
      </pre
    >
  </body>
</html>
<script>
  [1, 2, 3].fill(4); //[4,4,4]
</script>
